import { ApiProperty } from '@nestjs/swagger';
import { IsString, MinLength } from 'class-validator';
import type { ILoginRequest } from '@nbase/shared';

/**
 * 登录 DTO
 * 实现 shared 中的接口，添加运行时验证
 */
export class LoginDto implements ILoginRequest {
  @ApiProperty({
    description: '用户名',
    example: 'admin',
    minLength: 3,
  })
  @IsString()
  @MinLength(3)
  username!: string;

  @ApiProperty({
    description: '密码',
    example: 'admin123',
    minLength: 6,
  })
  @IsString()
  @MinLength(6)
  password!: string;
}

